﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.OracleClient;

public partial class KetQua : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DataConnection.str = @"Data Source=xe;User ID=ODER;Password=12345";
        string noidung = Request.QueryString["noidung"];
        noidung = noidung.ToUpper();
        int loaiTK = int.Parse(Request.QueryString["loai"]);

        DataTable bang = new DataTable();
        OracleConnection con = new OracleConnection();
        OracleDataAdapter da = new OracleDataAdapter();

        string storeProcedureName = "";
        if (loaiTK == 0)
            storeProcedureName = "NGOCTRAN.sp_getSachByTenSach";

        else
        {
            storeProcedureName = "NGOCTRAN.sp_getSachByNhaXB";            
        }
         OracleParameter[] thamso = new OracleParameter[]
        {
            new OracleParameter("p_content",noidung),
            
        };

         bang = DataConnection.GetDatatableByStoreProcedureNameCursor(storeProcedureName, thamso);
        dlsanpham.DataSource = bang;
        dlsanpham.DataBind();

        if (bang.Rows.Count == 0)
            lblThongBao.Visible = true;
        else lblThongBao.Visible = false;

        
                
    }

    protected void dlsanpham_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}